用清华源等国内镜像加速Python常用库的安装

您所在的位置:网站首页 tuna 镜像 用清华源等国内镜像加速Python常用库的安装

用清华源等国内镜像加速Python常用库的安装

2023-03-18 19:38| 来源: 网络整理| 查看: 265

在github上下载一些神经网络时,常看到requirement.txt文件,作者也提供了安装命令pip install -r requirements.txt,  然而这样直接安装速度较慢,因此通过添加国内的镜像源可以加快所需库的安装速度,命令如下:

pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

当单独安装某个库的时候,比如numpy,可以使用如下命令:

pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple

有时通过清华镜像源安装会出现问题,可以尝试通过更改为其它国内的镜像源来解决,如下是国内的其它镜像源:

#清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ #中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ #豆瓣(douban) http://pypi.douban.com/simple/ #中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/ #阿里云 http://mirrors.aliyun.com/pypi/simple/

更改示例:

#更改为阿里云镜像 pip install numpy -i http://mirrors.aliyun.com/pypi/simple/


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3